package com.flashflexpro.flexdirector.model{
    import flash.utils.getQualifiedClassName;

    /**
     *
     * abstract
     */
    [Bindable]
    [RemoteClass]
    public class DtoReusable extends NameAndComment{

        public var id:String;

        override public function getId():String{
            return id;
        }

        public function DtoReusable(){
            /**
             * do I really need an id??
             * how about a createTimestamp?
             *
             */
            var fullClsPath:String = getQualifiedClassName( this );
            id = fullClsPath.substr( fullClsPath.indexOf( "::" ) + 2 ) + new Date().getTime();
        }

        override public function toString():String{
            return super.toString() + ";id=" + id + ";name=" + name;
        }

        public function equals( dto:DtoReusable ):Boolean{
            if( dto == null ){
                return false;
            }
            return id == dto.id;
        }

    }
}